<?php

echo "计算输入的两个整数的加减乘除的结果\n";
echo "请输入两个整数，用英文逗号分离：\n";


fscanf(STDIN, "%d,%d", $a, $b);

$he = $a + $b;
$cha = $a - $b;
$ji = $a * $b;

// 修复除零错误
if ($b == 0) {
    $shang = "错误：除数不能为0";
} else {
    $shang = $a / $b;
}

echo "$a + $b = $he\n";
echo "$a - $b = $cha\n";
echo "$a * $b = $ji\n";
echo "$a / $b = $shang\n";

